<!DOCTYPE html>
<html>
<head>
	
	<title>Print Rincian Biaya Farmasi</title>
	<style type="text/css" media="print">
		.tc{
            display: none;
       }
       .containerf4 {
			background-color: #FFF;
			width: 9.3cm;
			margin: 0 auto;
			padding:4px;
			border-bottom: 0px solid #ccc;
		}
	</style>
	<style type="text/css">
	body {
		background-color: #ddd;
		font-size: 11pt;
		font-family: "Times New Roman";
	}
	@media all {
 	.page-break { display: none; }
	}
	@media print {
 	.page-break { display: block; page-break-before: always; }
	}
	.clearfix {
		clear: both;
	}
	.coba {
		background-color: #00ff00;
	}
	.containerf4 {
		background-color: #FFF;
		width: 9.3cm;
		margin: 0 auto;
		padding:4px;
		border-bottom: 0px solid #ccc;
	}
	.judul {
		text-align: center;
	}
	.text-center {
		text-align: center;
	}
	.text-bold {
		font-weight: bold;
	}
	.justify {
		text-align: justify;
	}
	h1 {
		font-size: 16pt;
	}
	h2 {
		font-size: 10pt;
		margin-bottom: 3px;
		margin-top: 5px;
		line-height: 0.8;
	}
	.table-full {
		width: 100%;
	}
	table {
		border-collapse: collapse;
		border-color: #000;
	}
	table.head{
		border:1px solid #000;
	}
	table tr td, table tr th {
		padding: 3px 5px;
		vertical-align: top;
		border:1px solid #000;
	} 
	table.head tr td, table.head tr th {
		padding: 3px 5px;
		font-size: 8pt;
		padding: 1px 2px;
		border:none;
	} 

	table.petugas tr td, table.petugas tr th {
		font-size: 8pt;
		padding: 1px 2px;
		border:none;
	} 

	table tr td.content {
		font-family: verdana;
	}
	table tr td.jasa {
		border: 1px solid #000;
		font-family: verdana;
	}
	.numbering {
		margin: 0;
		padding: 0;
		list-style-type: decimal;
	}
	.numbering li {
		margin-left: 35px;
		line-height: 1.5;
	}
	</style>

</head>

<body>
<!-- ================================== awal halaman ======================================= -->
<div class="containerf4">
	<div class="clearfix"></div>
	<?php 
	if(!empty($list)){
	?>

	<h2 align="center">APOTEK FARMASI</h2>
	<h2 align="center"><?= strtoupper($list['ppk']) ?></h2>
	<table class="table-full head">
		<tr>
			<td align="center" colspan="4">RINCIAN BIAYA FARMASI</td>
			<td colspan="2" align="right"><?= $jam; ?></td>
		</tr>
		<tr>
			<td width="22%">Nama Pasien</td>
			<td width="1%">:</td>
			<td width="23"><?= substr(strtoupper($list['nama']), 0,18) ?></td>
			<td width="17%">Invoice</td>
			<td width="1%">:</td>
			<td width="22%">0</td>
		</tr>
		<tr>
			<td>Umur</td>
			<td>:</td>
			<td><?= hitung_usia($list['tgl_lahir'])?></td>
			<td>Tgl Masuk</td>
			<td>:</td>
			<td><?= id_date($list['tgl_transaksi'],$option="short_b")?></td>
		</tr>
		<tr>
			<td>Medical Record</td>
			<td>:</td>
			<td><?= $list['no_rm']?></td>
			<td>Tgl Keluar</td>
			<td>:</td>
			<td><?= id_date($list['tgl_transaksi'],$option="short_b")?></td>
		</tr>
		<tr>
			<td>Dokter Pengirim</td>
			<td>:</td>
			<td><?= substr($list['dokter'], 0,20)?></td>
			<td>Ruang</td>
			<td>:</td>
			<td><?= substr($list['unit'],0,15)?></td>
		</tr>
		<tr>
			<td>Petugas</td>
			<td>:</td>
			<td><?= substr($list['first_name']." ".$list['last_name'], 0,20) ?></td>
			<td>Status PS</td>
			<td>:</td>
			<td>JAMKESDA</td>
		</tr>
	</table>
	<div class="clearfix" style="margin-top:2px;"></div>
	<table class="table-full head">

		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
	<?php
		$total=0;
		$no=1; 
		foreach ($klaim_obat as $value) {
		$subtotal = $value['tarif_diminta']*$value['frekuensi_diminta'];
	?>
		<tr>
			<td class="content" align="center" width="6%"><?= $no; ?></td>
			<td class="content" width="50%"><?= strtoupper($value['obat']." ".$value['merk']) ?></td>
			<td class="content" align="center" width="15%"><?= $value['frekuensi_diminta'] ?></td>
			<td class="content" width="25%"><?= formatRupiahTabelB($subtotal) ?></td>
		</tr>
	<?php

		$total=$total+$subtotal;
		$no++; 
		}
	?>
		
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		
		<tr>
		    <td class="jasa" align="center" colspan="2">Kolom Portier /</td>
		    <td class="jasa" align="center"><?= $jml_portir ?></td>
		    <td class="jasa" align="center"><?= $tarif_portir ?></td>
		</tr>
		<tr>
		    <td class="jasa" colspan="2" align="center">Kolom Resep /</td>
		    <td  class="jasa" align="center"><?= $jml_resep ?></td>
		    <td class="jasa" align="center"><?= $tarif_resep ?></td>
		</tr>
		<tr>
		    <td class="jasa" colspan="2" align="center">Biaya Pemakaian O<sup>2</sup></td>
		    <td class="jasa" align="center"><?= $jml_oksigen ?></td>
		    <td class="jasa" align="center"><?= $tarif_oksigen ?></td>
		</tr>
		<tr>
		    <td class="jasa" colspan="3" align="center">JUMLAH</td>
		    <?php $jumlah=$total+($resep_tarif*$jml_resep)+($portir_tarif*$jml_portir)+($oksigen_tarif*$jml_oksigen);?>
		    <td class="jasa" align="center"><?= formatRupiahTabelB($jumlah) ?></td>
		</tr>
	</table>
	<div class="clearfix" style="margin-top:4px;"></div>
	<table class="table-full petugas">
		<tr>
			<td width="65%"></td>
			<td align="center" width="35%">Petugas</td>
		</tr>
		<tr>
			<td width="65%"></td>
			<td align="center" width="35%"><?= $list['first_name']." ".$list['last_name']?></td>
		</tr>
	</table>
	<div style="text-align:center;" class="tc">[<a href="#print" onclick="print(); window.location.href = '<?= site_url("apotik")?>'" >CETAK</a>]</div>
	<?php
	}else{
		echo '<h2 align="center">TIDAK ADA DATA</h2>';
	}
	?>
</div>
<!-- ================================== akhir halaman ======================================= -->

</body>
</html>